<?php

namespace App\Model;
/**
 * lzy
 * Class AuthRule
 * @package App\Model
 */
class  AuthGroup extends BaseModel
{

    /**
     * 权列表
     * @param $data 提交数据
     * @param $where  条件
     */
    public function getAuthGroupList($data, $where)
    {
        $limit = $data['limit'] ?? 10;
        $condition = $this->analysisWhere($where);
        return $this->getPageAll($condition, $data['page'], $limit);
    }

    /**
     * 更新权限组
     * @param $where
     * @param $data
     * @return mixed
     * @throws \EasySwoole\Mysqli\Exceptions\ConnectFail
     * @throws \EasySwoole\Mysqli\Exceptions\PrepareQueryFail
     * @throws \Throwable
     */
    public function updateAuthGroup($where, $data)
    {
        $condition = $this->analysisWhere($where);
        return $this->editData($condition, $data);
    }

    /**
     * 获取权限组信息
     * @param $where
     */
    public function getAuthGroupInfo($where)
    {
        return $this->findOne($where);
    }

}